<?php defined('SYSPATH') or die('No direct script access.');
require ('application/classes/dao/base.php');
class Controller_dictionary extends Controller {

	public function action_list(){

		try{
	        $query = DB::query(Database::SELECT,
	         'select * from sysDictionary where categroy ="acto" or categroy="act"')->execute()->as_array();
		}catch(Exception $e){

			echo json_encode(error($e->getMessage()));
			exit;
		}
		echo json_encode(success($query));
    }

    public function action_listGroup(){

		try{
	        $query = DB::query(Database::SELECT,
	         'select * from sysDictionary where categroy ="acto"  ')->execute()->as_array();
	        $result  = success($query);
	        $query1 = DB::query(Database::SELECT,
	         'select * from sysDictionary where categroy ="act"  ')->execute()->as_array();
	        $result['act'] = $query1;
		}catch(Exception $e){

			echo json_encode(error($e->getMessage()));
			exit;
		}
		echo json_encode(error($result));
    }

} // End Welcome
